package com.xxlie.auth.security.auth.ajax;

import java.util.Map;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;

/**
 * 登录请求
 * LoginRequest
 *
 * @author xxlie.com
 * @since 2017/9/27
 */
public class LoginPhoneRequest {
    private String phone;
    private String password;
    private String smsCode;
    private Map<String, Object> extraParams;

    @JsonCreator
    public LoginPhoneRequest(@JsonProperty("phone") String phone, @JsonProperty("password") String password, @JsonProperty("smsCode") String smsCode, @JsonProperty("extraParams") Map<String, Object> extraParams) {
        this.phone = phone;
        this.password = password;
        this.smsCode = smsCode;
        this.extraParams = extraParams;
    }

    @NotNull(message = "手机号不能为空")
    @Length(min = 11, max = 15, message = "请输入正确数位的手机号")
    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getSmsCode() {
        return smsCode;
    }

    public void setSmsCode(String smsCode) {
        this.smsCode = smsCode;
    }

    public Map<String, Object> getExtraParams() {
        return extraParams;
    }

    public void setExtraParams(Map<String, Object> extraParams) {
        this.extraParams = extraParams;
    }

}
